<template>
  <div class="app-container">
    <el-form ref="form" :model="form" label-width="120px">
      <el-form-item label="爬取地址" prop="fundUrl">
        <el-input v-model="form.fundUrl" />
      </el-form-item>
      <el-form-item label="基金代码" prop="fundCode">
        <el-input v-model="form.fundCode" />
      </el-form-item>
      <el-form-item label="基金名称" prop="fundName">
        <el-input v-model="form.fundName" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">添加</el-button>
        <el-button @click="onCancel">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { add } from '@/api/fundSource'

export default {
  data() {
    return {
      form: {
        fundUrl: null,
        fundCode: null,
        fundName: null
      }
    }
  },

  methods: {
    onSubmit() {
      var vm = this
      add(vm.form).then(response => {
        var msg = response.message
        vm.$message.success(msg)
      })
    },
    onCancel() {
      // this.$store.dispatch('delVisitedViews', this.$route)
      this.$router.go(-1)
    }
  }
}
</script>

<style scoped>
.line{
  text-align: center;
}
</style>

